package GUI.Demo01;

import java.awt.*;

public class Test {
    public static void main(String[] args) {
        Frame frame = new Frame();
        frame.setSize(500,500);
        frame.setLocation(200,200);
        Color color = new Color(0x81E1B3);
        frame.setBackground(color);
        frame.setVisible(true);
        frame.setLayout(new GridLayout(2,1));
        //创建面板
        Panel p1 = new Panel(new BorderLayout());
        Panel p2 = new Panel(new GridLayout(2,1));
        Panel p3 = new Panel(new BorderLayout());
        Panel p4 = new Panel(new GridLayout(2,2));
        //添加按钮至面板
        p1.add(new Button("1 Left"),BorderLayout.WEST);
        p1.add(new Button("1 Right"),BorderLayout.EAST);
        p2.add(new Button("One"));
        p2.add(new Button("Two"));
        p1.add(p2,BorderLayout.CENTER);
        p3.add(new Button("2 Left"),BorderLayout.WEST);
        p3.add(new Button("2 Right"),BorderLayout.EAST);
        p4.add(new Button("Three"));
        p4.add(new Button("Four"));
        p4.add(new Button("Five"));
        p4.add(new Button("Six"));
        p3.add(p4,BorderLayout.CENTER);
        //将面板放入窗口中
        frame.add(p1);
        frame.add(p3);
    }
}
